<%@page pageEncoding="utf-8" %>
<script type="text/javascript">
	$("#saveBanner").linkbutton({    
    	iconCls: 'icon-add',
    	onClick:function(){
    		$('#addBanner-form').form('submit',{    
			    url:"${pageContext.request.contextPath}/banner/addBanner",    
			    onSubmit: function(){    
			        return $('#addBanner-form').form('validate');
			    },    
			    success:function(data){
			        $("#addBanner").dialog("close");
			    	$.messager.show({
								title:"提示",
								msg:"上传成功!"
							});    
			        $("#banner-tt").datagrid("reload");    
			    }    
			});    
    		
    	}   
	}); 
	$("#cancelBanner").linkbutton({
			iconCls: 'icon-back',
			onClick:function(){
				$("#addBanner").dialog("close");
			}
	})
	$("#addBanner-switchbutton").switchbutton({ 
	      checked: true,
	      required:true,
	      onText:'上线',
	      offText:'下线', 
	      onChange: function(checked){ 
		        	if(!checked){
			      	$(this).prop("value",0).val()
			        }
			      } 
    }) 
	
</script>
<form id="addBanner-form" method="post" enctype="multipart/form-data">   
  	选择上传文件图片：<input class="easyui-filebox"  data-options="buttonText:'选择文件',required:true" name="file"/><br/>
  	标题：<input class="easyui-textbox"  name="title" data-options="required:true" style="width:100px"> <br/>
  	状态：<input id="addBanner-switchbutton" name="status" value=1><br/>
  	上传时间：<input   id="dd"  type= "text" class= "easyui-datebox" required ="required" name="pub_date"/> <br/>
  	描述：<textarea class="easyui-textbox" data-options="multiline:true,height:110,width:200,required:true" name="description"></textarea><br/>
   <a id="saveBanner">确认</a>
   <a id="cancelBanner">取消</a>
</form>  
  